﻿/// <reference path="../../script/jquery-1.4.1.min.js" />
$(function () {
    $(".cssmenumouseout").live("mouseover", function () {
        $(this).attr("class", "cssmenumouseover");
    });
    $(".cssmenumouseover").live("mouseout", function () {
        $(this).attr("class", "cssmenumouseout");
    })
    $(".cssmenumouseoutlist").live("mouseover", function () {
        $(this).attr("class", "cssmenumouseoverlist");
    });
    $(".cssmenumouseoverlist").live("mouseout", function () {
        $(this).attr("class", "cssmenumouseoutlist");
    })
    var onemenu = $(".csswai").first();
    onemenu.children().attr("aaa", "aaa");
    $(".csswai").each(function () {
        if ($(this).children().attr("aaa") == "undefined" || $(this).children().attr("aaa") == undefined || $(this).children().attr("aaa") == null || $(this).children().attr("aaa") == "") {
            $(this).children().eq(0).nextAll().hide();
        }
        else {
            var str = $(this).children().next().get(0).tagName;
            if (str == "div" || str == "DIV") {
                $(this).children().next().children().eq(0).children().eq(0).attr("aaa", "aaa");
                $(this).children().next().children().each(function () {
                    if ($(this).children().attr("aaa") == "undefined" || $(this).children().attr("aaa") == undefined || $(this).children().attr("aaa") == null || $(this).children().attr("aaa") == "") {
                        $(this).children().eq(0).nextAll().hide();
                    }
                });
            }
        }
    });
    $(".cssmenumouseover").live("click", function () {
        if ($(this).next().css("display") == "none") {
            var str = $(this).next().get(0).tagName;
            if (str == "div" || str == "DIV") {
                $(this).next().children().eq(0).children().eq(0).attr("aaa", "aaa");
                $(this).next().children().each(function () {
                    if ($(this).children().attr("aaa") == "undefined" || $(this).children().attr("aaa") == undefined || $(this).children().attr("aaa") == null || $(this).children().attr("aaa") == "") {
                        $(this).children().eq(0).nextAll().hide();
                    }
                    else {
                        $(this).children().eq(0).nextAll().show();
                    }
                });
            }
            $(this).parent().parent().children().each(function () {
                $(this).children().eq(0).nextAll().slideUp("slow");
            });
            $(this).nextAll().slideDown("slow");
        }
        else {
            $(this).nextAll().slideUp("slow");
        }
    });
    $('.iframemainbody', window.parent.document).children().eq(0).attr("src", $(".cssmenumouseoutlist").eq(0).attr("url"));
});

function MainBodyUrl(op) {
    if ($("#" + op).attr("type") == "main") {
        $('.iframemainbody', window.parent.document).children().eq(0).attr("src", $("#" + op).attr("url"));
    }
    if ($("#" + op).attr("type") == "open") {
        window.open($("#" + op).attr("url"));
    }
}